package com.listening.framework.exception;

/**
 * 业务异常封装
 * 
 * @author Listening
 * 
 */
public class BusinessException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * 错误码
	 */
	private String errorCode;

	/**
	 * 错误描述
	 */
	private String errorMsg;

	public BusinessException() {
		super();
	}

	public BusinessException(String errorMsg) {
		super(errorMsg);
	}

	public BusinessException(String errorCode, String errorMsg) {
		super(errorCode + ":" + errorMsg);
		this.errorCode = errorCode;
		this.errorMsg = errorMsg;
	}

	public BusinessException(String errorCode, String errorMsg, Throwable e) {
		super(errorCode + ":" + errorMsg, e);
		this.errorCode = errorCode;
		this.errorMsg = errorMsg;
	}

	public String getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorMsg() {
		return errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

}
